<template>
  <div id="app">
    <router-view v-wechat-title='$route.meta.title'></router-view>
    <div class="mobile-nav-box flex">
        <div v-for="(item,index) in navList" :key="index">
          <router-link :to="item.path" class="nav-item" >
            <i :class="item.icon"></i>
            <span>{{item.name}}</span>
          </router-link>
        </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      navList: [{
        path: "/",
        name: "首页",
        icon: "el-icon-price-tag"
      },{
        path: "/CarCenter",
        name: "整车中心",
        icon: "el-icon-truck"
      },
      {
        path: "/buyCar",
        name: "在线购车",
        icon: "el-icon-shopping-cart-2"
      },
      {
        path: "/user/info",
        name: "个人中心",
        icon: "el-icon-s-custom"
      }]
    }
  }
}
</script> 
<style lang="scss" scoped>
#app {
  padding-top: 110px;
  box-sizing: border-box;
}
.mobile-nav-box {
  display: none;
}
@media (min-width: 320px) and (max-width: 800px){
  #app {
    padding-top: 75px;
    padding-bottom: 85px;
  }
  .mobile-nav-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 75px;
    background: #fff;
    .nav-item {
      display: flex;
      flex-direction: column;
      font-size: 14px;
      &.router-link-exact-active {
        color: #f9686c;
      }
    }
    i {
      font-size: 24px;
      margin-bottom: 6px;
    }
  }
}

</style>
